import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../layout/Index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: Index,
    children: [
      // 商品首页
      {
        path: '/',
        component: () =>
          import(/* webpackChunkName: "Goodslist" */ '../views/GoodsList')
      },
      // 商品详情
      {
        path: '/rate',
        component: () =>
          import(/* webpackChunkName: "GoodsRate" */ '../views/GoodsRate')
      },
      // 商品店铺
      {
        path: '/shop',
        component: () =>
          import(/* webpackChunkName: "GoodsShop" */ '../views/GoodsShop')
      }
    ]
  },
  {
    path: '/404',
    component: () =>
      import(/* webpackChunkName: "Offline" */ '../views/Offline')
  },
  {
    path: '/ad',
    component: () => import(/* webpackChunkName: "Offline" */ '../views/Ad')
  }
]
// component: () =>import(/* webpackChunkName: "about" */ '../views/About.vue')

const router = new VueRouter({
  routes
})

export default router
